class GoodDetailModel {
  Good good;

  GoodDetailModel({this.good});

  GoodDetailModel.fromJson(Map<String, dynamic> json) {
    good = json['good'] != null ? new Good.fromJson(json['good']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.good != null) {
      data['good'] = this.good.toJson();
    }
    return data;
  }
}

class Good {
  double noDiscountedPrice;
  double price;
  String image;
  String name;
  String description;
  List<Evaluations> evaluations;
  String id;

  Good(
      {this.noDiscountedPrice,
      this.price,
      this.image,
      this.name,
      this.description,
      this.evaluations,
      this.id});

  Good.fromJson(Map<String, dynamic> json) {
    noDiscountedPrice = json['noDiscountedPrice'];
    price = json['price'];
    image = json['image'];
    name = json['name'];
    description = json['description'];
    if (json['evaluations'] != null) {
      evaluations = new List<Evaluations>();
      json['evaluations'].forEach((v) {
        evaluations.add(new Evaluations.fromJson(v));
      });
    }
    id = json['id'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['noDiscountedPrice'] = this.noDiscountedPrice;
    data['price'] = this.price;
    data['image'] = this.image;
    data['name'] = this.name;
    data['description'] = this.description;
    if (this.evaluations != null) {
      data['evaluations'] = this.evaluations.map((v) => v.toJson()).toList();
    }
    data['id'] = this.id;
    return data;
  }
}

class Evaluations {
  User user;
  String content;
  int score;

  Evaluations({this.user, this.content, this.score});

  Evaluations.fromJson(Map<String, dynamic> json) {
    user = json['user'] != null ? new User.fromJson(json['user']) : null;
    content = json['content'];
    score = json['score'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.user != null) {
      data['user'] = this.user.toJson();
    }
    data['content'] = this.content;
    data['score'] = this.score;
    return data;
  }
}

class User {
  String id;
  String name;
  String picture;

  User({this.id, this.name, this.picture});

  User.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    picture = json['picture'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['picture'] = this.picture;
    return data;
  }
}